사이트 내 전체검색
UTF-8로 설정한 MySQL 4.1 이상 Tomcat 5.0 이상에서 JDBC접속 URL설정 오류
최고관리자
https://cmd.kr/server/14 URL이 복사되었습니다.

본문

euc-kr 이 아닌 서버도 utf-8이고 mysql도 UTF-8 인데 데이타가 깨어질경우
이전에는 :

jdbc:mysql://localhost:3306/dbname?useUnicode=true&characterEncoding=UTF8

5.0 이 되면서 부터 바뀌었다..


jdbc:mysql://localhost:3306/dbname?useUnicode=true&characterEncoding=UTF8&jdbcCompliantTruncation=false&useOldUTF8Behavior=true


참고로.. euc-kr -> form($_GET) 전송 -> utf-8 저장순서는 다음과 같다.
1. db 설정 utf-8로 고정
2. 보내는쪽에서 그냥 보내고,,
3. 받는쪽에서 ..
   $_GET[msg]=mb_convert_encoding($_GET[msg],"UTF-8","EUC-KR");
4. 저장은 그냥 utf-8로 저장된다.(DB 기본 charterset이 그러하다면..)

댓글목록

등록된 댓글이 없습니다.

1,139 (23/23P)

Search

Copyright © Cmd 명령어 18.118.129.43